package msg

import "github.com/name5566/leaf/network/json"

var Processor = json.NewProcessor()

func init() {
	// 关闭
	Processor.Register(&S2C_Close{})

	// 注册-登录
	Processor.Register(&C2S_Login{})
	Processor.Register(&S2C_Login{})
	Processor.Register(&C2S_Register{})
	Processor.Register(&S2C_Register{})
	Processor.Register(&S2C_User{}) //登录成功后发送玩家信息

	// 匹配玩家
	Processor.Register(&C2S_Matching{})
	Processor.Register(&S2C_Matching{})
	Processor.Register(&S2C_MatchingError{})

	// 心跳包
	//Processor.Register(&C2S_Pong{})

	// 战斗房间
	Processor.Register(&C2S_BattleReady{})        //战斗准备
	Processor.Register(&C2S_BattleLoadComplete{}) //载入战斗完成
	Processor.Register(&S2C_BattleStartGame{})    //所有玩家载入后,开始游戏
	Processor.Register(&S2C_BattleNextShot{})     //通知下一个玩家射箭
	Processor.Register(&C2S_BattleShot{})         //玩家射箭
	Processor.Register(&C2S_BattleShotComplete{}) //战斗-箭中靶了,射箭完毕.然后服务器可以通知下一位射箭者
	Processor.Register(&S2C_BattleShot{})         //广播给另一玩家射箭情况
	Processor.Register(&C2S_BattlePlayerLeave{})  //玩家离开房间
	Processor.Register(&S2C_BattlePlayerLeave{})  //通知有玩家离开
	Processor.Register(&S2C_BattleEnd{})          //通知游戏结束计分
	Processor.Register(&S2C_BattleException{})    //游戏异常结束
	Processor.Register(&C2S_BattleEmoji{})        //玩家发送表情
	Processor.Register(&S2C_BattleEmoji{})        //推送某玩家发的表情

}
